import 'dart:typed_data';
import 'dart:ui';
// import 'package:bitmap/bitmap.dart';
import 'package:flutter/material.dart';
import 'package:collection/collection.dart';
import 'led_converter.dart';
import 'dart:ui' as ui;
import 'package:image/image.dart' as imagePackage;
class Text12 {
  static const String TAG = "Text1456";
  static int textColor = 0xFFFFFFFF;

  static Future<Uint8List> getStringBytes(String str) async {
    List<Uint8List> linkedList = [];
    int i = 0;
    for (int index = 0; index < str.length; index++) {
      print("循环： $index");
      String c = str[index];
      Uint8List? charDataByFont;
      charDataByFont ??= getCharDataByFont(c);

      charDataByFont ??= await getCharDataByBitmap(c);
      linkedList.add(charDataByFont);
      i += charDataByFont.length;
    }
    late Uint8List bArr;
    // int i2 = 0;
    List<int> list = [];
    for (int i3 = 0; i3 < linkedList.length; i3++) {
      Uint8List bArr2 = linkedList[i3];
      for (var element in bArr2) {
        list.add(element);
      }
    }
    bArr = Uint8List.fromList(list);
    return bArr;
  }

  ///获取对应字符的字节数据
  static Uint8List? getCharDataByFont(String c) {
    if (c == 'A') {
      return get_A();
    }
    if (c == 'B') {
      return get_B();
    }
    if (c == 'C') {
      return get_C();
    }
    if (c == 'D') {
      return get_D();
    }
    if (c == 'E') {
      return get_E();
    }
    if (c == 'F') {
      return get_F();
    }
    if (c == 'G') {
      return get_G();
    }
    if (c == 'H') {
      return get_H();
    }
    if (c == 'I') {
      return get_I();
    }
    if (c == 'J') {
      return get_J();
    }
    if (c == 'K') {
      return get_K();
    }
    if (c == 'L') {
      return get_L();
    }
    if (c == 'M') {
      return get_M();
    }
    if (c == 'N') {
      return get_N();
    }
    if (c == 'O') {
      return get_O();
    }
    if (c == 'P') {
      return get_P();
    }
    if (c == 'Q') {
      return get_Q();
    }
    if (c == 'R') {
      return get_R();
    }
    if (c == 'S') {
      return get_S();
    }
    if (c == 'T') {
      return get_T();
    }
    if (c == 'U') {
      return get_U();
    }
    if (c == 'V') {
      return get_V();
    }
    if (c == 'W') {
      return get_W();
    }
    if (c == 'X') {
      return get_X();
    }
    if (c == 'Y') {
      return get_Y();
    }
    if (c == 'Z') {
      return get_Z();
    }
    if (c == '0') {
      return get_0();
    }
    if (c == '1') {
      return get_1();
    }
    if (c == '2') {
      return get_2();
    }
    if (c == '3') {
      return get_3();
    }
    if (c == '4') {
      return get_4();
    }
    if (c == '5') {
      return get_5();
    }
    if (c == '6') {
      return get_6();
    }
    if (c == '7') {
      return get_7();
    }
    if (c == '8') {
      return get_8();
    }
    if (c == '9') {
      return get_9();
    }
    if (c == 'a') {
      return get_a();
    }
    if (c == 'b') {
      return get_b();
    }
    if (c == 'c') {
      return get_c();
    }
    if (c == 'd') {
      return get_d();
    }
    if (c == 'e') {
      return get_e();
    }
    if (c == 'f') {
      return get_f();
    }
    if (c == 'g') {
      return get_g();
    }
    if (c == 'h') {
      return get_h();
    }
    if (c == 'i') {
      return get_i();
    }
    if (c == 'j') {
      return get_j();
    }
    if (c == 'k') {
      return get_k();
    }
    if (c == 'l') {
      return get_l();
    }
    if (c == 'm') {
      return get_m();
    }
    if (c == 'n') {
      return get_n();
    }
    if (c == 'o') {
      return get_o();
    }
    if (c == 'p') {
      return get_p();
    }
    if (c == 'q') {
      return get_q();
    }
    if (c == 'r') {
      return get_r();
    }
    if (c == 's') {
      return get_s();
    }
    if (c == 't') {
      return get_t();
    }
    if (c == 'u') {
      return get_u();
    }
    if (c == 'v') {
      return get_v();
    }
    if (c == 'w') {
      return get_w();
    }
    if (c == 'x') {
      return get_x();
    }
    if (c == 'y') {
      return get_y();
    }
    if (c == 'z') {
      return get_z();
    }
    if (c == '<') {
      return get_left();
    }
    if (c == '>') {
      return get_right();
    }
    if (c == ',') {
      return get_comma();
    }
    if (c == '.') {
      return get_period();
    }
    if (c == ';') {
      return get_fenhao();
    }
    if (c == ':') {
      return get_maohao();
    }
    if (c == '\'') {
      return get_suoxiehao();
    }
    if (c == '\"') {
      return get_shuangsuoxiehao();
    }
    if (c == '[') {
      return get_zuozhongkuohao();
    }
    if (c == ']') {
      return get_youzhongkuohao();
    }
    if (c == '{') {
      return get_zuodakuohao();
    }
    if (c == '}') {
      return get_youdakuohao();
    }
    if (c == '|') {
      return get_shuxian();
    }
    if (c == '\\') {
      return get_fanxiegang();
    }
    if (c == '/') {
      return get_xiegang();
    }
    if (c == '?') {
      return get_question();
    }
    if (c == '~') {
      return get_pozhehao();
    }
    if (c == '`') {
      return get_piedian();
    }
    if (c == '!') {
      return get_exclamation();
    }
    if (c == '@') {
      return get_xiaolaoshu();
    }
    if (c == '#') {
      return get_jinghao();
    }
    if (c == "\$") {
      return get_meiyuanfuhao();
    }
    if (c == '%') {
      return get_baifenbi();
    }
    if (c == '^') {
      return get_yunsuanfuhao();
    }
    if (c == '&') {
      return get_yufuhao();
    }
    if (c == '*') {
      return get_xinghao();
    }
    if (c == '(') {
      return get_zuokuohao();
    }
    if (c == ')') {
      return get_youkuohao();
    }
    if (c == '-') {
      return get_dash();
    }
    if (c == '_') {
      return get_xiahuaxian();
    }
    if (c == '+') {
      return get_add();
    }
    if (c == '=') {
      return get_equal();
    }
    if (c != ' ') {
      return null;
    }
    return get_space();
  }

  static Future<Uint8List> getCharDataByBitmap(String c)  async {
    Offset canvasSize = const Offset(12,12);
    // ui.Picture picture = LedConverter.convert(text: c, canvasSize: canvasSize,);
    // ByteData? imageBytes =  await pictureToBytes(picture,canvasSize,);
    // List<List<int>> byteList= bytesToPixelArray(imageBytes!,canvasSize,);
    // byteList.forEachIndexed((index,element) {
    //   // print("===========${element.map((e) {return e==1?"*":" ";}).toList()}  ${index+1}");
    //   print("===========  ${element[0]==1?" * ":"   "}${element[1]==1?" * ":"   "}${element[2]==1?" * ":"   "}${element[3]==1?" * ":"   "}${element[4]==1?" * ":"   "}${element[5]==1?" * ":"   "}${element[6]==1?" * ":"   "}${element[7]==1?" * ":"   "}${element[8]==1?" * ":"   "}${element[9]==1?" * ":"   "}${element[10]==1?" * ":"   "}${element[10]==1?" * ":"   "}  ${index+1}");
    // });
    // List<Uint8List> bArr=[];
    // byteList.forEachIndexed((index,element) {
    //   bArr.add(Uint8List.fromList(element));
    // });
    // print("===========bArr: ${bArr.length}");

    return getCharData(await getCharBitmapPointCheckData(LedConverter.convert(text: c, canvasSize: canvasSize), canvasSize));
  }

  static Future<List<Uint8List>> getCharBitmapPointCheckData(Picture picture, Offset canvasSize) async {
    final image = await picture.toImage(canvasSize.dx.toInt(), canvasSize.dy.toInt());
    final imageData = Uint8List.view((await image.toByteData())!.buffer);
    final List<Uint8List> columnRow = [];
    for (var column = 0; column < image.width; column++) {
      List<int> rowData = List.filled(image.height, 0);
      for (var row = 0; row < image.height; row++) {
        int pixelStartPosistion = (row * image.width * 4) + column * 4;
        final pixel = Color.fromARGB(imageData[pixelStartPosistion] + 3, imageData[pixelStartPosistion], imageData[pixelStartPosistion + 1], imageData[pixelStartPosistion + 2]);
        if (pixel.computeLuminance() > 0.5) {
          rowData[row] = 1;
        }
      }
      columnRow.add(Uint8List.fromList(rowData));
    }

    return columnRow;
  }

  ///获取图片字节数
  static Future<ByteData?> pictureToBytes(ui.Picture picture,Offset canvasSize,) async {
    final ui.Image img = await picture.toImage(canvasSize.dx.toInt(), canvasSize.dy.toInt());
    return await img.toByteData(format: ui.ImageByteFormat.png);
  }
  ///获取字节数组
  static List<List<int>> bytesToPixelArray(ByteData imageBytes, Offset canvasSize,) {
    List<int> values = imageBytes.buffer.asUint8List();
    imagePackage.Image decodedImage = imagePackage.decodeImage(values)!;
    List<List<int>> pixelArray =  List.generate(canvasSize.dx.toInt(), (index) => List.generate(canvasSize.dy.toInt(), (index) => 0));
    ///循环画布大小
    for (int i = 0; i < canvasSize.dx.toInt(); i++) {
      for (int j = 0; j < canvasSize.dy.toInt(); j++) {
        int pixel = decodedImage.getPixelSafe(i, j);
        // int pixel = decodedImage.getPixel(i, j);
        // int pixel = decodedImage.getPixelCubic(i, j);
        // int pixel = decodedImage.getPixelInterpolate(i, j);
        int hex = convertColorSpace(pixel);
        if(Color(hex).value!=0){
          pixelArray[i][j] =  1;
        }
      }
    }

    return pixelArray;
  }
  ///颜色空间转换
  static int convertColorSpace(int argbColor) {
    int r = (argbColor >> 16) & 0xFF;
    int b = argbColor & 0xFF;
    return (argbColor & 0xFF00FF00) | (b << 16) | r;
  }

  static Uint8List getCharData(List<Uint8List> bArr) {
    int i;
    int i2;
    Uint8List bArr2 = Uint8List(24);
    for (int i3 = 0; i3 < bArr.length; i3++) {
      Uint8List bArr3 = bArr[i3];
      int b = 0;
      int b2 = 0;
      for (int i4 = 0; i4 < bArr3.length; i4++) {
        if (bArr3[i4] == 1) {
          switch (i4) {
            case 0:
              i = b | -128;
              b = i;
              i;
              break;
            case 1:
              i = b | 64;
              b = i;
              i;
              break;
            case 2:
              i = b | 32;
              b = i;
              i;
              break;
            case 3:
              i = b | 16;
              b = i;
              i;
              break;
            case 4:
              i = b | 8;
              b = i;
              i;
              break;
            case 5:
              i = b | 4;
              b = i;
              i;
              break;
            case 6:
              i = b | 2;
              b = i;
              i;
              break;
            case 7:
              i = b | 1;
              b = i;
              i;
              break;
            case 8:
              i2 = b2 | -128;
              b2 = i2;
              i2;
              break;
            case 9:
              i2 = b2 | 64;
              b2 = i2;
              i2;
              break;
            case 10:
              i2 = b2 | 32;
              b2 = i2;
              i2;
              break;
            case 11:
              i2 = b2 | 16;
              b2 = i2;
              i2;
              break;
          }
        }
      }
      int i5 = i3 * 2;
      bArr2[i5] = b;
      bArr2[i5 + 1] = b2;
    }
    return bArr2;
  }


}

///Uint8List.fromList([]);
Uint8List get_A() {
  return Uint8List.fromList([3, -64, 29, 0, 97, 0, 29, 0, 3, -64, 0, 0]);
}

Uint8List get_B() {
  return Uint8List.fromList([127, -64, 68, 64, 68, 64, 68, 64, 59, -128, 0, 0]);
}

Uint8List get_C() {
  return Uint8List.fromList([63, -128, 64, 64, 64, 64, 64, 64, 1, -128, 0, 0]);
}

Uint8List get_D() {
  return Uint8List.fromList([127, -64, 64, 64, 64, 64, 32, -128, 31, 0, 0, 0]);
}

Uint8List get_E() {
  return Uint8List.fromList([127, -64, 68, 64, 68, 64, 68, 64, 64, 64, 0, 0]);
}

Uint8List get_F() {
  return Uint8List.fromList([127, -64, 68, 0, 68, 0, 68, 0, 64, 0, 0, 0]);
}

Uint8List get_G() {
  return Uint8List.fromList(
      [63, -128, 64, 64, 64, 64, 66, -128, 51, -64, 0, 0]);
}

Uint8List get_H() {
  return Uint8List.fromList([127, -64, 4, 0, 4, 0, 4, 0, 127, -64, 0, 0]);
}

Uint8List get_I() {
  return Uint8List.fromList([0, 0, 64, 64, 127, -64, 64, 64, 0, 0, 0, 0]);
}

Uint8List get_J() {
  return Uint8List.fromList([1, -128, 0, 64, 0, 64, 127, -128, 0, 0, 0, 0]);
}

Uint8List get_K() {
  return Uint8List.fromList([127, -64, 4, 0, 27, 0, 96, -64, 0, 0, 0, 0]);
}

Uint8List get_L() {
  return Uint8List.fromList([127, -64, 0, 64, 0, 64, 0, 64, 0, 64, 0, 0]);
}

Uint8List get_M() {
  return Uint8List.fromList([127, -64, 28, 0, 3, -64, 28, 0, 127, -64, 0, 0]);
}

Uint8List get_N() {
  return Uint8List.fromList([127, -64, 48, 0, 14, 0, 1, -128, 127, -64, 0, 0]);
}

Uint8List get_O() {
  return Uint8List.fromList([63, -128, 64, 64, 64, 64, 64, 64, 63, -128, 0, 0]);
}

Uint8List get_P() {
  return Uint8List.fromList([127, -64, 68, 0, 68, 0, 68, 0, 56, 0, 0, 0]);
}

Uint8List get_Q() {
  return Uint8List.fromList([63, -128, 64, 64, 65, 64, 64, -128, 63, 64, 0, 0]);
}

Uint8List get_R() {
  return Uint8List.fromList([127, -64, 68, 0, 68, 0, 70, 0, 57, -64, 0, 0]);
}

Uint8List get_S() {
  return Uint8List.fromList([1, -128, 72, 64, 68, 64, 66, 64, 1, -128, 0, 0]);
}

Uint8List get_T() {
  return Uint8List.fromList([64, 0, 64, 0, 127, -64, 64, 0, 64, 0, 0, 0]);
}

Uint8List get_U() {
  return Uint8List.fromList([127, -128, 0, 64, 0, 64, 0, 64, 127, -128, 0, 0]);
}

Uint8List get_V() {
  return Uint8List.fromList([112, 0, 14, 0, 1, -64, 14, 0, 112, 0, 0, 0]);
}

Uint8List get_W() {
  return Uint8List.fromList([124, 0, 3, -64, 124, 0, 3, -64, 124, 0, 0, 0]);
}

Uint8List get_X() {
  return Uint8List.fromList([96, -64, 27, 0, 4, 0, 27, 0, 96, -64, 0, 0]);
}

Uint8List get_Y() {
  return Uint8List.fromList([96, 0, 24, 0, 7, -64, 24, 0, 96, 0, 0, 0]);
}

Uint8List get_Z() {
  return Uint8List.fromList([64, -64, 67, 64, 68, 64, 88, 64, 96, 64, 0, 0]);
}

Uint8List get_a() {
  return Uint8List.fromList([5, -128, 10, 64, 10, 64, 7, -128, 0, 64, 0, 0]);
}

Uint8List get_b() {
  return Uint8List.fromList([127, -64, 8, 64, 8, 64, 8, 64, 7, -128, 0, 0]);
}

Uint8List get_c() {
  return Uint8List.fromList([7, -128, 8, 64, 8, 64, 8, 64, 4, -128, 0, 0]);
}

Uint8List get_d() {
  return Uint8List.fromList([7, -128, 8, 64, 8, 64, 8, 64, 127, -64, 0, 0]);
}

Uint8List get_e() {
  return Uint8List.fromList([7, -128, 10, 64, 10, 64, 10, 64, 6, -128, 0, 0]);
}

Uint8List get_f() {
  return Uint8List.fromList([8, 0, 63, -64, 72, 0, 64, 0, 0, 0, 0, 0]);
}

Uint8List get_g() {
  return Uint8List.fromList([5, 64, 10, -96, 10, -96, 4, -96, 8, 64, 0, 0]);
}

Uint8List get_h() {
  return Uint8List.fromList([127, -64, 8, 0, 8, 0, 8, 0, 7, -64, 0, 0]);
}

Uint8List get_i() {
  return Uint8List.fromList([0, 0, 0, 0, 111, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_j() {
  return Uint8List.fromList([0, 32, 0, 32, 111, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_k() {
  return Uint8List.fromList([127, -64, 1, 0, 3, 0, 4, -128, 8, 64, 0, 0]);
}

Uint8List get_l() {
  return Uint8List.fromList([0, 0, 0, 0, 127, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_m() {
  return Uint8List.fromList([15, -64, 8, 0, 7, -64, 8, 0, 7, -64, 0, 0]);
}

Uint8List get_n() {
  return Uint8List.fromList([15, -64, 8, 0, 8, 0, 8, 0, 7, -64, 0, 0]);
}

Uint8List get_o() {
  return Uint8List.fromList([7, -128, 8, 64, 8, 64, 8, 64, 7, -128, 0, 0]);
}

Uint8List get_p() {
  return Uint8List.fromList([15, -32, 8, -128, 8, -128, 8, -128, 7, 0, 0, 0]);
}

Uint8List get_q() {
  return Uint8List.fromList([7, 0, 8, -128, 8, -128, 8, -128, 15, -32, 0, 0]);
}

Uint8List get_r() {
  return Uint8List.fromList([0, 0, 15, -64, 4, 0, 8, 0, 8, 0, 0, 0]);
}

Uint8List get_s() {
  return Uint8List.fromList([4, -128, 10, 64, 10, 64, 9, 64, 4, -128, 0, 0]);
}

Uint8List get_t() {
  return Uint8List.fromList([8, 0, 127, -128, 8, 64, 0, 64, 0, 0, 0, 0]);
}

Uint8List get_u() {
  return Uint8List.fromList([15, -128, 0, 64, 0, 64, 0, 64, 15, -64, 0, 0]);
}

Uint8List get_v() {
  return Uint8List.fromList([12, 0, 3, 0, 0, -64, 3, 0, 12, 0, 0, 0]);
}

Uint8List get_w() {
  return Uint8List.fromList([14, 0, 1, -64, 14, 0, 1, -64, 14, 0, 0, 0]);
}

Uint8List get_x() {
  return Uint8List.fromList([8, 64, 4, -128, 3, 0, 4, -128, 8, 64, 0, 0]);
}

Uint8List get_y() {
  return Uint8List.fromList([12, 32, 3, 32, 0, -64, 3, 0, 12, 0, 0, 0]);
}

Uint8List get_z() {
  return Uint8List.fromList([8, 64, 8, -64, 9, 64, 10, 64, 12, 64, 0, 0]);
}

Uint8List get_0() {
  return Uint8List.fromList([63, -128, 64, 64, 64, 64, 63, -128, 0, 0, 0, 0]);
}

Uint8List get_1() {
  return Uint8List.fromList([0, 0, 32, 0, 127, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_2() {
  return Uint8List.fromList([48, -64, 67, 64, 68, 64, 56, 64, 0, 0, 0, 0]);
}

Uint8List get_3() {
  return Uint8List.fromList([1, -128, 68, 64, 68, 64, 59, -128, 0, 0, 0, 0]);
}

Uint8List get_4() {
  return Uint8List.fromList([3, 0, 13, 0, 1, 0, 127, -64, 1, 0, 0, 0]);
}

Uint8List get_5() {
  return Uint8List.fromList([125, -128, 72, 64, 72, 64, 71, -128, 0, 0, 0, 0]);
}

Uint8List get_6() {
  return Uint8List.fromList([63, -128, 68, 64, 68, 64, 51, -128, 0, 0, 0, 0]);
}

Uint8List get_7() {
  return Uint8List.fromList([64, 0, 65, -64, 78, 0, 112, 0, 0, 0, 0, 0]);
}

Uint8List get_8() {
  return Uint8List.fromList([59, -128, 68, 64, 68, 64, 59, -128, 0, 0, 0, 0]);
}

Uint8List get_9() {
  return Uint8List.fromList([57, -128, 68, 64, 68, 64, 63, -128, 0, 0, 0, 0]);
}

Uint8List get_pozhehao() {
  return Uint8List.fromList([64, 0, -128, 0, -128, 0, 64, 0, -128, 0, 0, 0]);
}

Uint8List get_piedian() {
  return Uint8List.fromList([0, 0, -128, 0, 64, 0, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_exclamation() {
  return Uint8List.fromList([0, 0, 0, 0, -4, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_xiaolaoshu() {
  return Uint8List.fromList([63, -128, 82, 64, 94, 64, 65, 64, 62, -128, 0, 0]);
}

Uint8List get_jinghao() {
  return Uint8List.fromList(
      [32, -128, -1, -32, 32, -128, -1, -32, 32, -128, 0, 0]);
}

Uint8List get_meiyuanfuhao() {
  return Uint8List.fromList([1, -128, 72, 64, -1, -32, 68, 64, 51, -128, 0, 0]);
}

Uint8List get_baifenbi() {
  return Uint8List.fromList(
      [96, -64, -109, 0, 109, -128, 2, 64, -63, -128, 0, 0]);
}

Uint8List get_yunsuanfuhao() {
  return Uint8List.fromList([0, 0, 64, 0, -128, 0, 64, 0, 0, 0, 0, 0]);
}

Uint8List get_yufuhao() {
  return Uint8List.fromList(
      [103, -128, -104, 64, 102, 64, 1, -128, 6, 64, 0, 0]);
}

Uint8List get_xinghao() {
  return Uint8List.fromList([27, 0, 4, 0, 63, -128, 4, 0, 27, 0, 0, 0]);
}

Uint8List get_zuokuohao() {
  return Uint8List.fromList([0, 0, 31, 0, 96, -64, -128, 32, 0, 0, 0, 0]);
}

Uint8List get_youkuohao() {
  return Uint8List.fromList([0, 0, -128, 32, 96, -64, 31, 0, 0, 0, 0, 0]);
}

Uint8List get_xiahuaxian() {
  return Uint8List.fromList([0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16]);
}

Uint8List get_add() {
  return Uint8List.fromList([4, 0, 4, 0, 63, -128, 4, 0, 4, 0, 0, 0]);
}

Uint8List get_dash() {
  return Uint8List.fromList([4, 0, 4, 0, 4, 0, 4, 0, 0, 0, 0, 0]);
}

Uint8List get_equal() {
  return Uint8List.fromList([18, 0, 18, 0, 18, 0, 18, 0, 0, 0, 0, 0]);
}

Uint8List get_zuodakuohao() {
  return Uint8List.fromList([0, 0, 4, 0, -5, -32, -128, 32, 0, 0, 0, 0]);
}

Uint8List get_youdakuohao() {
  return Uint8List.fromList([0, 0, -128, 32, -5, -32, 4, 0, 0, 0, 0, 0]);
}

Uint8List get_zuozhongkuohao() {
  return Uint8List.fromList([0, 0, 0, 0, -1, -32, -128, 32, -128, 32, 0, 0]);
}

Uint8List get_youzhongkuohao() {
  return Uint8List.fromList([-128, 32, -128, 32, -1, -32, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_shuxian() {
  return Uint8List.fromList([0, 0, 0, 0, -1, -16, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_fanxiegang() {
  return Uint8List.fromList([0, 0, -64, 0, 48, 0, 14, 0, 1, -128, 0, 96]);
}

Uint8List get_maohao() {
  return Uint8List.fromList([0, 0, 24, -64, 24, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_fenhao() {
  return Uint8List.fromList([0, 0, 24, -96, 24, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_shuangsuoxiehao() {
  return Uint8List.fromList([32, 0, -64, 0, 32, 0, -64, 0, 0, 0, 0, 0]);
}

Uint8List get_suoxiehao() {
  return Uint8List.fromList([0, 0, -96, 0, -64, 0, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_left() {
  return Uint8List.fromList([4, 0, 10, 0, 17, 0, 32, -128, 64, 64, 0, 0]);
}

Uint8List get_right() {
  return Uint8List.fromList([64, 64, 32, -128, 17, 0, 10, 0, 4, 0, 0, 0]);
}

Uint8List get_comma() {
  return Uint8List.fromList([0, 0, 0, -96, 0, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_period() {
  return Uint8List.fromList([0, 0, 0, -64, 0, -64, 0, 0, 0, 0, 0, 0]);
}

Uint8List get_question() {
  return Uint8List.fromList([48, 0, 64, 0, 70, -64, 56, 0, 0, 0, 0, 0]);
}

Uint8List get_xiegang() {
  return Uint8List.fromList([0, 96, 1, -128, 14, 0, 48, 0, -64, 0, 0, 0]);
}

Uint8List get_space() {
  return Uint8List.fromList([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
}

bool isZhFont(String? str) {
  return str == '' || str == null || str.isEmpty;
}
